using System;
using System.Collections;
using FlowCanvas;
using FlowCanvas.Nodes;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
using UnityEngine.Playables;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class AddGuideTag : CallableActionNodeBase
    {
        public enum GuideTag
        {
            ForceGuideStart = 0,
            ForceGuideEnd = 1,
            StoryGuideStart = 2,
            StoryGuideEnd = 3,
        }
        
        [RequiredField]
        public BBParameter<GuideTag> tag; //标记

        public override string name
        {
            get
            {
                return string.Format("{0} ({1})", "AddGuideTag", tag.value);
            }
        }
        
        public void Invoke()
        {
            BlueprintUtils.AddGuideTag(tag.value.ToString());
        }
        
        protected override void OnRegisterPorts(FlowNode node)
        {
            var o = node.AddFlowOutput("Out");
            node.AddFlowInput("In", (Flow f) =>
            {
                Invoke();
                o.Call(f);
            });
        }

    }
}